package com.yuju.enums;
/**
 * \
 * 类名：LoginReturnCodeEnum  <br />
 *
 * 功能：登录功能相关
 *
 * @author : zhousc <br />
 * @Date : 2018年1月8日 上午10:26:54  <br />
 * @version : 1.1 <br />
 */
public enum LoginReturnCodeEnum {
	NOT_REGISTERED("yuju-login-1000", "手机号未注册"),
	LOGIN_SUCCESS("yuju-login-1001", "登录成功"),
	LOGIN_FAILURE("yuju-login-1002", "登录失败，密码错误"),
	VAILD_FAILURE("yuju-login-1003", "登录失败，验证码错误"),
	NEED_USER_ID("yuju-login-1004", "请输出账户ID");
	private String code;
	private String desc;
	
	LoginReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (LoginReturnCodeEnum enume : LoginReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}